#ifndef __WIZ_THREAD_HPP__SHANHAOBO_19800429__
#define __WIZ_THREAD_HPP__SHANHAOBO_19800429__

#include "../../Base/WizBase.hpp"
#include "./WizThreadRunnable.hpp"

namespace Wiz
{
    namespace Thread
    {
        //////////////////////////////////////////////////////////////////////////
        class WIZ_EXPORT Type : public ::Wiz::Noncopyable::Type
        {
        public:
            struct Core_t
            {
                virtual ~Core_t(){}
            };
        private:
            ::Wiz::Thread::Type::Core_t*    m_Core;
        public:
            Type(::Wiz::Thread::Runnable::Ptr RPtr, ::Wiz::Bool::In AutoRM = ::Wiz::Bool::False)
            {
                WIZ_ASSERT(::Wiz::IsValidPtr(RPtr));
                if (CreateCore(RPtr, AutoRM) == ::Wiz::Bool::False)
                {
                    WIZ_ASSERT(::Wiz::Bool::False);
                }
            }
            ~Type()
            {
                DestroyCore();
            }
        private:
            ::Wiz::Bool::Type CreateCore(::Wiz::Thread::Runnable::Ptr r, ::Wiz::Bool::In AutoRM);
            ::Wiz::Void::Type DestroyCore();
        };
        WIZ_DECLARE(::Wiz::Thread::Type);
        //////////////////////////////////////////////////////////////////////////
    } /// end of namespace Thread
} /// end of namespace Wiz

#endif /*__WIZ_THREAD_HPP__SHANHAOBO_19800429__*/
